package com.google.code.lebar.bean.builders;

import com.google.code.lebar.bean.Layer;
import com.google.code.lebar.bean.request.LayarRequest;
import com.google.code.lebar.bean.response.LayarResponse;

public class LayarResponseBuilder
{
    private LayarResponse mBuiltResponse = null;
    
    private LayarResponseBuilder( String pLayerName )
    {
        mBuiltResponse = new LayarResponse();
        mBuiltResponse.setLayer( pLayerName );
    }

    public static LayarResponseBuilder forLayer( String pLayerName )
    {
        return new LayarResponseBuilder( pLayerName );
    }

    public static LayarResponseBuilder forLayer( Layer pLayer )
    {
        return forLayer( pLayer.getLayerName() );
    }

    public static LayarResponseBuilder fromRequest( LayarRequest pRequest )
    {
        return forLayer( pRequest.getLayerName() );
    }
    
    public LayarResponse build()
    {
        return mBuiltResponse.clone();
    }

}
